//
//  NTESSocket.h
//  ScreenRecord_ios_oc
//
//  Created by 51talk on 2021/5/21.
//

#ifndef NTESSocket_h
#define NTESSocket_h

@protocol SocketRecieve <NSObject>

-(void)onRecvData:(uint8_t *)data len:(int)length;

@end

@interface NTESSocket : NSObject
{
    id<SocketRecieve> _delegate;
}

-(void)setDelegate:(id<SocketRecieve>)delegate;
-(NTESSocket *)initWithPort:(NSString*)port ip:(NSString*)ip;
-(void)startAcceptClient;

-(bool) connectToServerWithPort:(NSString*)port ip:(NSString*)ip;
-(void)sendData:(uint8_t*)data length:(int)length;

-(void)closeSocket;

@end

#endif /* NTESSocket_h */
